import React from 'react';
import { connect } from 'umi';
import type { AppStateType } from '@/models/app';
import TopSearch from './components/TopSearch';
import Banner from './components/Banner';
import Catgray from './components/Catgray';
import Bottom from './components/Bottom';

type HomeProps = {
  config: AppStateType;
};

const Home: React.FC<HomeProps> = (props) => {
  return (
    <div
      style={{
        background: 'white',
      }}
    >
      <TopSearch tableId={props.config.table_id} />
      <Banner />
      <Catgray />
      <Bottom />
    </div>
  );
};

export default connect(
  ({
    app,
    loading,
  }: {
    app: AppStateType;
    loading: {
      effects: Record<string, boolean>;
    };
  }) => {
    return {
      config: app,
      loading,
    };
  },
)(Home);
